import autoCssModules from '@ebonex/rollup-plugin-auto-css-modules';
import { type Plugin } from 'vite';
import modelsPlugin from '../plugin/rollup-plugin-models';
import pluginExports from '../plugin/vite-plugin-exports';
import i18n from '../plugin/vite-plugin-i18n';
import react from '@/plugin/vite-plugin-react';
import routerPlugin from '@/plugin/vite-plugin-router';
import accessPlugin from '@/plugin/vite-plugin-access';
export function vitePlugins(){
  return  [
    pluginExports(),
    routerPlugin(),
    accessPlugin(),
    modelsPlugin(),
    ...react(),
    autoCssModules() as Plugin,
    i18n(),
    {
      name: 'vite-plugin-alias',
     config(){
      return {resolve: {
        alias: {
          '@': '/src/',
          qps: '/src/.qps/exports.ts',
        },
      }};
     }
    }
  ];
};